package stbm.objects;

import stbm.guihelpers.GameSpecifics;

public class GasStation {

	public static final int FUEL_COST = 2; // credits

	/*
	 * Allows the player to buy more gas
	 * 
	 * @param player
	 * 
	 * @param ship
	 * 
	 * @param liters
	 * 
	 * @return true/false depending on whether the player was allowed to fuel up
	 */
	public boolean fuelUp(Player player, Ship ship, int litres) {

		if (ship.getTank() + litres > GameSpecifics.FULL_TANK) {
			return false;
		} else {
			player.setCredits(player.getCredits() - FUEL_COST);
			ship.addToTank(litres);
			return true;
		}

	}

}
